const nodeXlsx = require("node-xlsx");
const fs = require("fs");
const path = require("path")
const utils = require("../utils/common")
function readFile(){
    return nodeXlsx.parse(fs.readFileSync(path.resolve(utils.staticUrl(),'file','test.xlsx')));
}
function setFile(data){
    const bufferData = nodeXlsx.build([{name: 'mySheetName', data:  data}]);
    fs.writeFileSync(path.resolve(utils.staticUrl(),'file','test.xlsx'), Buffer.from(bufferData));
}
module.exports = {
    readFile,
    setFile
}